css: Improve spec compliance of the radial gradient parser
authorMatthias Clasen <mclasen@redhat.com>
Mon, 7 Nov 2016 20:40:21 +0000 (15:40 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 7 Nov 2016 20:40:21 +0000 (15:40 -0500)
The spec says:
"If <shape> is omitted, the ending shape defaults to a circle if the <size>
is a single <length>, and to an ellipse otherwise."

Make it so.

gtk/gtkcssimageradial.c

index 1d4b99bc181761c2f1401db7ea3e9bee2a0aef72..e22d9b805bafb25a8f8fe81d2d25e096c2811bb7 100644 (file)
@@ -323,10 +323,10 @@ gtk_css_image_radial_parse (GtkCssImage  *image,
 
   if (!has_shape)
     {
-      if (radial->sizes[0] && radial->sizes[1])
-        radial->circle = FALSE;
-      else
+      if (radial->sizes[0] && !radial->sizes[1])
         radial->circle = TRUE;
+      else
+        radial->circle = FALSE;
     }
 
   if (has_shape && radial->circle)